package com.ruoyi.common.utils;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;

public class IdGenerator {

    // 需要全局唯一，否则生成的id可能会重复
    public static final Snowflake snowflake = IdUtil.getSnowflake(1, 1);

    public static Long getId () {
       return snowflake.nextId();
    }
}
